package demo.issuetracker.dao.jpa;

import demo.issuetracker.entity.UploadedFile;
import demo.issuetracker.entity.Issue;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.CascadeType;


import demo.issuetracker.entity.User;

/**
 * Issue
 */
@Entity
@Table(name="issue")
public class JpaIssue implements Issue {
    private static final long serialVersionUID = 1L;



    /** Id */
    @Id
    @Basic
    private String id;

    /** 
     * Get Id.
     *  
     * @return the id
     */
    public String getId() {
       return this.id;
    }

    /**
     * Set Id
     *
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }



    /** Title */
    @Basic
    private String title;

    /** 
     * Get Title.
     *  
     * @return the title
     */
    public String getTitle() {
       return this.title;
    }

    /**
     * Set Title
     *
     * @param title
     */
    public void setTitle(String title) {
        this.title = title;
    }



    /** Description */
    @Basic
    private String description;

    /** 
     * Get Description.
     *  
     * @return the description
     */
    public String getDescription() {
       return this.description;
    }

    /**
     * Set Description
     *
     * @param description
     */
    public void setDescription(String description) {
        this.description = description;
    }


    public static enum Priority {
    high, normal, low    };


    /** Priority */
    @Basic
    private String priority;

    /** 
     * Get Priority.
     *  
     * @return the priority
     */
    public String getPriority() {
       return this.priority;
    }

    /**
     * Set Priority
     *
     * @param priority
     */
    public void setPriority(String priority) {
        this.priority = priority;
    }


    public static enum Assignee {
    jonathan, steven, evan, nicole, vineet, will    };


    /** Whom is the project assigned to? The id of the user in the project */
    @Basic
    private String assignee;

    /** 
     * Get Assignee.
     *  
     * @return the assignee
     */
    public String getAssignee() {
       return this.assignee;
    }

    /**
     * Set Assignee
     *
     * @param assignee
     */
    public void setAssignee(String assignee) {
        this.assignee = assignee;
    }



    /** Owner of this issue */
    @Basic
    @javax.persistence.ManyToOne(targetEntity=JpaUser.class)
    private User owner;

    /** 
     * Get Owner.
     *  
     * @return the owner
     */
    public User getOwner() {
       return this.owner;
    }

    /**
     * Set Owner
     *
     * @param owner
     */
    public void setOwner(User owner) {
        this.owner = owner;
    }


    public static enum Environment {
    prod, test, dev    };


    /** The environment of where the issue was found. Valid values, 'Production', 'Testing' and 'Development' */
    @Basic
    private String environment;

    /** 
     * Get Environment.
     *  
     * @return the environment
     */
    public String getEnvironment() {
       return this.environment;
    }

    /**
     * Set Environment
     *
     * @param environment
     */
    public void setEnvironment(String environment) {
        this.environment = environment;
    }



    /** Attachments, if any */
    @Basic
    @javax.persistence.ManyToOne(targetEntity=JpaUploadedFile.class, cascade=CascadeType.ALL)
    private demo.issuetracker.entity.UploadedFile attachment;

    /** 
     * Get Attachment.
     *  
     * @return the attachment
     */
    public demo.issuetracker.entity.UploadedFile getAttachment() {
       return this.attachment;
    }

    /**
     * Set Attachment
     *
     * @param attachment
     */
    public void setAttachment(demo.issuetracker.entity.UploadedFile attachment) {
        this.attachment = attachment;
    }



    public String primaryKey() {
        return getId();
    }
    
    @Override
    public String toString() {
        return primaryKey();
    }
}// clickframes::version=820059729::clickframes